package com.wfm.leetcode.editor.cn;

/**
 * a^0=a
 * a^a=0
 *
 * [1,2,3,2,1]
 * 可以认为：1^1抵消=0 2^2抵消=0
 * 最终0^3=3
 */
public class POne36只出现一次的数字{
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public int singleNumber(int[] nums) {
        int single = 0;
        for (int num : nums) {
            single ^= num;
        }
        return single;
    }
}
//leetcode submit region end(Prohibit modification and deletion)

    public static void main(String[] args) { 
        Solution solution = new POne36只出现一次的数字().new Solution();
    }
}